home *** CD-ROM | disk | FTP | other *** search
- Copyright 1986 by Nourse, Gregg & Browne, Inc.
- 1 Horizon Rd. #612
- Fort Lee, NJ 07024
-
- PLEASE keep the above text with this file !
-
- /* ----------------------------------------------------------------- */
- /* ----------------------------------------------------------------- */
-
-
- Window
-
- Window is simple and easy to use (ie. there's not much to it)
-
- up to 31 windows can be open at once.
-
- /* ----------------------------------------------------------------- */
-
-
- to open a window call from your Lattice C program, code as follows:
-
-
-
- window_handle = wopen(top,left,bottom,right,attr,title);
-
-
-
- int window_handle;
-
- int top, left, bottom, right, attr;
-
- char *title;
-
-
- (note: 'title' can be NULL if no title is wanted)
-
- /* ----------------------------------------------------------------- */
-
- to close a window:
-
-
-
- wclose(window_handle);
-
-
- int window_handle;
-
-
-
- /* ----------------------------------------------------------------- */
-
- to send text to a window:
-
-
- wprint(window_handle,text);
-
-
- int window_handle;
-
- char *text;
-
-
-
- Note: The following special characters are processed:
-
- CR ( move cursor to left side of window )
- LF ( move cursor down 1 line, scroll if necessary )
- BS ( move cursor 1 position to the left )
-
- /* ----------------------------------------------------------------- */
-
- to position the cursor of a window (each window has it's own):
-
- wlocate(window_handle,row,col) /* move cursor relative to origin */
-
-
- int window_handle, /* the handle from wopen() */
-
- row, /* the relative row (from 0) */
-
- col; /* the relative column (from 0) */
-
-
- /* ----------------------------------------------------------------- */
-
- to print text at a location within a window
-
- this is just a wlocate() and a wprint() inside,
- but you might find it usefull...
-
- wsay(window_handle,row,col,text) /* move corsor + print text */
-
-
- int window_handle, /* the handle from wopen() */
-
- row, /* row to move cursor to */
-
- col; /* columne to move cursor to */
-
- char *text; /* text to print at that location */
-
-
- /* ----------------------------------------------------------------- */
-
- to input a character string at a window location:
-
-
- winput(window_handle,row,col,field,len) /* input text from window */
-
-
- int window_handle, /* handle from wopen() */
-
- row, /* row to input from */
-
- col, /* column to input from */
-
- len; /* max length of input field */
-
- char *field; /* default read from, and input put into here */
-
-
-
- /* ----------------------------------------------------------------- */
-
- to select from a list of choices:
-
- wselect(window_handle,row,col,field,list) /* select from a list */
-
-
- int window_handle, /* handle from wopen() */
-
- row,col; /* window relative position */
-
- char *field, /* copy of selection put here */
-
- *list[]; /* vector of strings of selections */
-
-
- the list[] above could be coded like this:
-
- static char *choice_list[] = {
- "Red",
- "Blue",
- "Green",
- "Yellow",
- "White",
- "Black",
- NULL}; <=== Note: last entry is NULL
-
- /* ----------------------------------------------------------------- */
-
- /* ----------------------------------------------------------------- */